<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="util.DBUtils"%>
<%@page import="java.sql.*"%>
<%@page import="javax.naming.NamingException"%>
<%@page import="java.util.*"%>
<%@page import="java.util.Map.Entry"%>
<%
Connection c;
try {
    c = DBUtils.getConnction("jdbc/oracle");
//    c = getConnction("jdbc/trswcm");
    String sql = "SELECT * FROM T_SQL_TYPE";
    Statement s = c.createStatement();
    ResultSet rs = s.executeQuery(sql);
    Map<String, Integer> type = DBUtils.getColumnTypes(rs);
    //System.out.println(rs.next());
    List<Map<String, Object>> values = DBUtils.getColumnValues(rs, type.keySet().toArray(new String[0]));
    Set<Map.Entry<String, Integer>> set = type.entrySet();
    for (Entry<String, Integer> entry : set) {
        Object o = values.get(0).get(entry.getKey());
        System.out.println(entry.getKey() + "\t" + DBUtils.types.get(entry.getValue()) + "\t" +  (null == o ? "null" : o.getClass().getName()));
    }
    //DBUtils.close(rs);
    //DBUtils.close(s);
    //DBUtils.close(c);
} catch (NamingException e) {
    e.printStackTrace();
} catch (SQLException e) {
    e.printStackTrace();
}
%>